#define _CRT_SECURE_NO_WARNINGS 1

#include "sort.h"

void TestInsertSort()
{
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5, 1, 2, 3, 5, 1, 8, 3 };
	BubbleSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestShellSort()
{
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5, 1, 2, 3, 5, 1, 8, 3 };
	ShellSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestBubbleSort()
{
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5, 1, 2, 3, 5, 1, 8, 3 };
	BubbleSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestHeapSort()
{
	int a[] = { 10, 6, 7, 1, 3, 9, 4, 2, 5, 1, 1 };
	//int a[] = { 9,1,2,5,7,4,8,6,3,5,1,2,3,5,1,8,3 };
	HeapSort(a,sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSort()
{
	int a[] = { 10, 6, 7, 1, 3, 9, 4, 2, 5, 1, 1 };
	//int a[] = { 9,1,2,5,7,4,8,6,3,5,1,2,3,5,1,8,3 };
	QuickSort(a, 0, sizeof(a) / sizeof(int)-1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestMergeSort()
{
	//int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	int a[] = { 10, 6, 7, 1, 3, 9, 4, 2, 5, 1, 1 };
	MergeSortNonR(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

int main()
{
	TestInsertSort();
	TestShellSort();
	TestBubbleSort();
	TestHeapSort();
	TestQuickSort();
	TestMergeSort();
	return 0;
}

